//
//  ZYCTeachLearningLocalDataManager.m
//  ZDSC
//
//  Created by ZDTX on 2021/9/7.
//

#import "ZYCTeachLearningLocalDataManager.h"
#import "ZYCTeachLearningSubmitModel.h"
#import "ZYCUserLoginModel.h"
@implementation ZYCTeachLearningLocalDataManager

+ (BOOL)saveLocalPaper:(ZYCTeachLearningSubmitModel *)model{
    
    
    NSLog(@"************************ 保存 ******************");
    ZYCUserLoginModel *userLogin = [ZYCUserLoginModel userLogin];
    NSMutableArray * array = [[NSMutableArray alloc] initWithArray:[[NSUserDefaults standardUserDefaults] objectForKey:userLogin.userId]];
    
    NSData * data= [NSKeyedArchiver archivedDataWithRootObject:model];
    [array addObject:data];
    NSUserDefaults * userDefault = [NSUserDefaults standardUserDefaults];
    [userDefault setObject:array forKey:userLogin.userId];
    
    return [userDefault synchronize];
}
@end
